package com.three.mapper;

import com.three.entity.BranchGoods;
import com.three.vo.GoodsNameAndCountVo;
import com.three.vo.GoodsidAndCountVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
* @author 天天好心情
* @description 针对表【branch_goods】的数据库操作Mapper
* @createDate 2024-10-25 11:46:06
* @Entity com.three.entity.BranchGoods
*/
public interface BranchGoodsMapper {

    int deleteByPrimaryKey(Long id);

    int insert(BranchGoods record);

    int insertSelective(BranchGoods record);

    BranchGoods selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(BranchGoods record);

    int updateByPrimaryKey(BranchGoods record);

    //根据门店id和商品id修改商品数量
    int updateCountsByBranchidAndGoodsid
    (@Param("branchid") Integer branchid,@Param("goodsid") Integer goodsid,@Param("counts") Integer counts);


    //审核通过，修改商品数量，根据branchid和goodsid
    int updateByBranchidAndGoodsid(
            @Param("goodsid") Integer goodsid,
            @Param("num") Integer num,
            @Param("branchid") Integer branchid);

    BranchGoods selectByGidAndBid(@Param("goodsid") Integer goodsid,@Param("branchid") Integer branchid);


    // 根据branchid查询有几件商品
    Integer getGoodsCounts(Integer branchid);
    //计算本门店商品库存统计
    List<GoodsNameAndCountVo> getGoodsAndNameCounts(Integer branchid);
}
